package com.ruoyi.factorydata.domain;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import lombok.*;

import java.util.Date;
import java.util.List;

/**
 * 物料库存信息对象 material_inventory
 *
 * @author ruoyi
 * @date 2025-07-23
 */
@Getter
@Setter
@Builder
@AllArgsConstructor
@NoArgsConstructor
@TableName(resultMap = "com.ruoyi.factorydata.mapper.MaterialInventoryMapper.MaterialInventoryResult")
public class MaterialInventory extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 批次
     */
    @Excel(name = "批次")
    private String batchNumber;

    /**
     * 仓库id
     */
    @Excel(name = "仓库id")
    private Long warehouseId;

    /**
     * 仓库编码
     */
    @Excel(name = "仓库编码")
    private String warehouseCode;

    /**
     * 库位id
     */
    @Excel(name = "库位id")
    private Long warehousePositionId;

    /**
     * 库位编码
     */
    @Excel(name = "库位编码")
    private String warehousePositionCode;

    /**
     * 物料id
     */
    @Excel(name = "物料id")
    private Long materialId;
    /**
     * 物料编码
     */
    @Excel(name = "物料编码")
    private String materialCode;

    /**
     * 物料名称
     */
    @Excel(name = "物料名称")
    private String materialName;

    /**
     * 物料规格
     */
    @Excel(name = "物料规格")
    private String materialSpecification;

    /**
     * 制造方式
     */
    @Excel(name = "制造方式")
    private String manufacturingMethod;

    /**
     * 计量单位
     */
    @Excel(name = "计量单位")
    private Long materialUnit;

    /**
     * 物料类型
     */
    @Excel(name = "物料类型")
    private String materialType;

    /**
     * 物料分类
     */
    @Excel(name = "物料分类")
    private Long materialCategory;

    /**
     * 库存
     */
    @Excel(name = "库存")
    private Long stockQuantity;
    /**
     * 入库日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "入库日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date receiptDate;
    /**
     * 删除标志（0代表存在 2代表删除）
     */
    @TableLogic(value = "0", delval = "2")
    private String delFlag;

    /**
     * 版本号
     */
    @Excel(name = "版本号")
    @Version
    private Long version;

    /**
     * 计量单位
     */
    @Excel(name = "计量单位")
    @TableField(exist = false)
    private String materialUnitName;

    /**
     * 物料分类
     */
    @Excel(name = "物料分类")
    @TableField(exist = false)
    private String materialCategoryName;

    /**
     * 仓库名称
     */
    @Excel(name = "仓库名称")
    @TableField(exist = false)
    private String warehouseName;

    /**
     * 库位名称
     */
    @Excel(name = "库位名称")
    @TableField(exist = false)
    private String warehousePositionName;
    /**
     * 库龄
     */
    @Excel(name = "库龄")
    @TableField(exist = false)
    private Integer stockAge;

    /**
     *  产成品关联工单信息：只有扫码才会关联
     */
    @TableField(exist = false)
    private List<WorkOrderInfo> workOrderInfoList;


    /**
     * 物料图片
     */
    @TableField(exist = false)
    private String materialImages;

    /**
     * 生产日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date productionDate;

    /**
     * 客户id
     */
    @TableField(exist = false)
    private Long customerId;
    /**
     * 客户名称
     */
    @TableField(exist = false)
    private String customerCode;

    /**
     * 备注
     */
    @Excel(name = "备注")
    @TableField(exist = false)
    private String remark;
}